#ifndef NEOCALENDARDELEGATE_H
#define NEOCALENDARDELEGATE_H

#include "def.h"
#include <QStyledItemDelegate>

class NeoCalendarDelegate : public QStyledItemDelegate
{
public:
    NeoCalendarDelegate(QObject *parent = nullptr);
    ~NeoCalendarDelegate();

    void setDisplayMode(NeoCalendarType::DisplayMode mode);
    void setTransparent(bool transparent);

    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;

private:
    const int mYearShowRowCount{4};
    const int mYearShowColumnCount{4};
    const int mMonthShowRowCount{4};
    const int mMonthShowColumnCount{4};
    const int mDayShowRowCount{6};
    const int mDayShowColumnCount{7};
    const int mSpace{2};

    NeoCalendarType::DisplayMode mDisplayMode;
    bool mIsTransparent;
};

#endif